@dss-kit/ui-kit 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/builders/Table/Table.js +58 -57
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.d.ts +0 -5
- package/dist/components/builders/Table/TableBodyRow/TableBodyRow.js +15 -11
- package/dist/components/builders/Table/TableWrapper/TableWrapper.js +38 -39
- package/dist/components/charts/LineChart/LineChart.js +17 -15
- package/dist/components/charts/PieProgressChart/PieProgressChart.js +16 -14
- package/dist/node_modules/@highcharts/react/Highcharts.js +161 -0
- package/dist/node_modules/@highcharts/react/options/Title.js +14 -0
- package/dist/node_modules/@highcharts/react/options/Tooltip.js +14 -0
- package/dist/ui-kit.cjs +8 -8
- package/package.json +1 -1
- package/dist/components/builders/Table/styles.d.ts +0 -3
- package/dist/components/builders/Table/styles.js +0 -11
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as o, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import { cx as p, css as b } from "@emotion/css";
|
|
3
|
-
import { useReactTable as He, getPaginationRowModel as Me, getSortedRowModel as Ne, getCoreRowModel as ke, flexRender as H, createColumnHelper as
|
|
4
|
-
import { useMemo as
|
|
3
|
+
import { useReactTable as He, getPaginationRowModel as Me, getSortedRowModel as Ne, getCoreRowModel as ke, flexRender as H, createColumnHelper as ze } from "@tanstack/react-table";
|
|
4
|
+
import { useMemo as Ie, useImperativeHandle as Ve } from "react";
|
|
5
5
|
import Le from "../../../assets/svg/table/search.svg.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useControllableState as
|
|
6
|
+
import { typography as We } from "../../../styles/utils/typography.js";
|
|
7
|
+
import { useControllableState as m } from "./Table.hooks.js";
|
|
8
8
|
import { getColumnPinningStyles as f } from "./Table.utils.js";
|
|
9
|
-
import { TablePlaceholder as
|
|
10
|
-
import { TableWrapper as
|
|
9
|
+
import { TablePlaceholder as Ee } from "./TablePlaceholder/TablePlaceholder.js";
|
|
10
|
+
import { TableWrapper as Fe } from "./TableWrapper/TableWrapper.js";
|
|
11
11
|
import { TableHeadRow as je } from "./TableHeadRow/TableHeadRow.js";
|
|
12
12
|
import { TablePagination as Be } from "./TablePagination/TablePagination.js";
|
|
13
13
|
import { TableHeadCell as De } from "./TableHeadCell/TableHeadCell.js";
|
|
@@ -19,32 +19,34 @@ import { TableHeadCellContent as Oe } from "./TableHeadCellContent/TableHeadCell
|
|
|
19
19
|
import { TableHeadCellContentSortable as $e } from "./TableHeadCellContentSortable/TableHeadCellContentSortable.js";
|
|
20
20
|
import { theme as qe } from "../../../utils/theme/index.js";
|
|
21
21
|
import { Box as Ge } from "../Box/Box.js";
|
|
22
|
-
const { spacing: M, color:
|
|
22
|
+
const { spacing: M, color: l } = qe, Je = b({
|
|
23
|
+
...We.body2,
|
|
24
|
+
fontWeight: 500,
|
|
23
25
|
width: "100%",
|
|
24
26
|
maxWidth: "100%",
|
|
25
27
|
minWidth: "max-content",
|
|
26
28
|
borderCollapse: "collapse",
|
|
27
29
|
borderSpacing: 0,
|
|
28
|
-
backgroundColor:
|
|
30
|
+
backgroundColor: l.fill.bgPrimary
|
|
29
31
|
}), Qe = b({
|
|
30
|
-
backgroundColor:
|
|
31
|
-
color:
|
|
32
|
+
backgroundColor: l.fill.bgSecondary,
|
|
33
|
+
color: l.text.tertiary
|
|
32
34
|
}), Ue = b({
|
|
33
35
|
pointerEvents: "none",
|
|
34
36
|
userSelect: "none"
|
|
35
37
|
}), N = ["70%", "55%", "80%", "60%"], c = ({
|
|
36
|
-
ref:
|
|
38
|
+
ref: z,
|
|
37
39
|
data: h,
|
|
38
40
|
columns: u,
|
|
39
41
|
showBorders: g = !0,
|
|
40
|
-
enableSorting:
|
|
42
|
+
enableSorting: I = !1,
|
|
41
43
|
enablePagination: S = !1,
|
|
42
44
|
enableRowSelection: V = !1,
|
|
43
45
|
enableMultiRowSelection: L = !1,
|
|
44
46
|
enableColumnPinning: d = !1,
|
|
45
|
-
columnPinning:
|
|
46
|
-
onColumnPinningChange:
|
|
47
|
-
sorting:
|
|
47
|
+
columnPinning: W,
|
|
48
|
+
onColumnPinningChange: E,
|
|
49
|
+
sorting: F,
|
|
48
50
|
onSortingChange: j,
|
|
49
51
|
manualSorting: B,
|
|
50
52
|
columnFilters: D,
|
|
@@ -55,7 +57,7 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
55
57
|
onPaginationChange: $,
|
|
56
58
|
rowSelection: q,
|
|
57
59
|
onRowSelectionChange: G,
|
|
58
|
-
totalCount:
|
|
60
|
+
totalCount: s,
|
|
59
61
|
loading: i = !1,
|
|
60
62
|
loadingRowCount: J = 10,
|
|
61
63
|
emptyLabels: Q = {
|
|
@@ -70,47 +72,47 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
70
72
|
emptyStateClassName: Z,
|
|
71
73
|
emptyStateTitleClassName: ee,
|
|
72
74
|
emptyStateDescriptionClassName: oe,
|
|
73
|
-
paginationClassName:
|
|
74
|
-
tableOptions:
|
|
75
|
+
paginationClassName: ne,
|
|
76
|
+
tableOptions: te = {},
|
|
75
77
|
onRowClick: w,
|
|
76
|
-
getRowId:
|
|
78
|
+
getRowId: le,
|
|
77
79
|
headCellComponent: ie = De,
|
|
78
80
|
bodyCellComponent: x = _e,
|
|
79
81
|
headRowComponent: ae = je,
|
|
80
82
|
bodyRowComponent: R = Ae,
|
|
81
83
|
onReset: re,
|
|
82
|
-
paginationVariant:
|
|
83
|
-
paginationLabels:
|
|
84
|
+
paginationVariant: me,
|
|
85
|
+
paginationLabels: se,
|
|
84
86
|
renderPageSizeSelectorDropdownItem: ce,
|
|
85
87
|
renderPageSizeSelectorInputItem: ge
|
|
86
88
|
}) => {
|
|
87
|
-
const [de, pe] =
|
|
88
|
-
|
|
89
|
+
const [de, pe] = m(
|
|
90
|
+
F,
|
|
89
91
|
j,
|
|
90
92
|
[]
|
|
91
|
-
), [he, Ce] =
|
|
93
|
+
), [he, Ce] = m(
|
|
92
94
|
D,
|
|
93
95
|
_,
|
|
94
96
|
[]
|
|
95
|
-
), [fe, be] =
|
|
97
|
+
), [fe, be] = m(
|
|
96
98
|
A,
|
|
97
99
|
K,
|
|
98
100
|
{}
|
|
99
|
-
), [a, C] =
|
|
101
|
+
), [a, C] = m(
|
|
100
102
|
O,
|
|
101
103
|
$,
|
|
102
104
|
{ pageIndex: 0, pageSize: 10 }
|
|
103
|
-
), [ue, Se] =
|
|
105
|
+
), [ue, Se] = m(q, G, {}), [ye, we] = m(
|
|
106
|
+
W,
|
|
104
107
|
E,
|
|
105
|
-
F,
|
|
106
108
|
{ left: [], right: [] }
|
|
107
|
-
), T = B ?? !!
|
|
109
|
+
), T = B ?? !!s, xe = Ie(
|
|
108
110
|
() => u.map((e) => ({
|
|
109
111
|
enableSorting: !1,
|
|
110
112
|
...e
|
|
111
113
|
})),
|
|
112
114
|
[u]
|
|
113
|
-
),
|
|
115
|
+
), t = He({
|
|
114
116
|
data: h,
|
|
115
117
|
columns: xe,
|
|
116
118
|
state: {
|
|
@@ -128,41 +130,40 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
128
130
|
onRowSelectionChange: Se,
|
|
129
131
|
onColumnPinningChange: we,
|
|
130
132
|
getCoreRowModel: ke(),
|
|
131
|
-
getSortedRowModel:
|
|
133
|
+
getSortedRowModel: I && !T ? Ne() : void 0,
|
|
132
134
|
getPaginationRowModel: S ? Me() : void 0,
|
|
133
135
|
enableRowSelection: V,
|
|
134
136
|
enableMultiRowSelection: L,
|
|
135
137
|
enableColumnPinning: d,
|
|
136
|
-
getRowId:
|
|
138
|
+
getRowId: le,
|
|
137
139
|
manualSorting: T,
|
|
138
|
-
manualPagination: !!
|
|
139
|
-
pageCount:
|
|
140
|
-
...
|
|
140
|
+
manualPagination: !!s,
|
|
141
|
+
pageCount: s ? Math.ceil(s / a.pageSize) : void 0,
|
|
142
|
+
...te
|
|
141
143
|
});
|
|
142
|
-
Ve(
|
|
143
|
-
const { rows: P } =
|
|
144
|
-
w && w(e.original,
|
|
144
|
+
Ve(z, () => t);
|
|
145
|
+
const { rows: P } = t.getRowModel(), Re = (e, n) => {
|
|
146
|
+
w && w(e.original, n);
|
|
145
147
|
}, Te = (e) => /* @__PURE__ */ o(
|
|
146
148
|
ie,
|
|
147
149
|
{
|
|
148
150
|
style: {
|
|
149
151
|
width: e.getSize(),
|
|
150
|
-
...d && f(
|
|
152
|
+
...d && f(t, e.column, l.fill.bgSecondary)
|
|
151
153
|
},
|
|
152
154
|
onClick: i ? void 0 : e.column.getToggleSortingHandler(),
|
|
153
155
|
children: e.isPlaceholder ? null : H(e.column.columnDef.header, e.getContext())
|
|
154
156
|
},
|
|
155
157
|
e.id
|
|
156
|
-
), Pe = (e,
|
|
158
|
+
), Pe = (e, n) => /* @__PURE__ */ o(
|
|
157
159
|
R,
|
|
158
160
|
{
|
|
159
161
|
showBorders: g,
|
|
160
|
-
|
|
161
|
-
onClick: () => Re(e, l),
|
|
162
|
+
onClick: () => Re(e, n),
|
|
162
163
|
children: e.getVisibleCells().map((r) => /* @__PURE__ */ o(
|
|
163
164
|
x,
|
|
164
165
|
{
|
|
165
|
-
style: d ? f(
|
|
166
|
+
style: d ? f(t, r.column, l.fill.bgPrimary) : void 0,
|
|
166
167
|
children: H(r.column.columnDef.cell, r.getContext())
|
|
167
168
|
},
|
|
168
169
|
r.id
|
|
@@ -173,10 +174,10 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
173
174
|
R,
|
|
174
175
|
{
|
|
175
176
|
showBorders: g,
|
|
176
|
-
children:
|
|
177
|
+
children: t.getVisibleLeafColumns().map((n, r) => /* @__PURE__ */ o(
|
|
177
178
|
x,
|
|
178
179
|
{
|
|
179
|
-
style: d ? f(n, l
|
|
180
|
+
style: d ? f(t, n, l.fill.bgPrimary) : void 0,
|
|
180
181
|
children: /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(
|
|
181
182
|
Ke,
|
|
182
183
|
{
|
|
@@ -186,20 +187,20 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
186
187
|
}
|
|
187
188
|
) })
|
|
188
189
|
},
|
|
189
|
-
|
|
190
|
+
n.id
|
|
190
191
|
))
|
|
191
192
|
},
|
|
192
193
|
`skeleton-row-${e}`
|
|
193
194
|
);
|
|
194
195
|
return !i && !P.length ? /* @__PURE__ */ o(
|
|
195
|
-
|
|
196
|
+
Ee,
|
|
196
197
|
{
|
|
197
198
|
icon: /* @__PURE__ */ o(
|
|
198
199
|
Le,
|
|
199
200
|
{
|
|
200
201
|
width: 24,
|
|
201
202
|
height: 24,
|
|
202
|
-
style: { color:
|
|
203
|
+
style: { color: l.icon.tertiary, marginBottom: M.sm }
|
|
203
204
|
}
|
|
204
205
|
),
|
|
205
206
|
labels: Q,
|
|
@@ -209,7 +210,7 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
209
210
|
descriptionClassName: oe
|
|
210
211
|
}
|
|
211
212
|
) : /* @__PURE__ */ v(Ge, { w: "full", gap: M.xl, className: p(y), children: [
|
|
212
|
-
/* @__PURE__ */ o(
|
|
213
|
+
/* @__PURE__ */ o(Fe, { data: h, showBorders: g, children: /* @__PURE__ */ v("table", { className: p(Je, U), children: [
|
|
213
214
|
/* @__PURE__ */ o(
|
|
214
215
|
"thead",
|
|
215
216
|
{
|
|
@@ -219,27 +220,27 @@ const { spacing: M, color: t } = qe, Je = b({
|
|
|
219
220
|
X
|
|
220
221
|
),
|
|
221
222
|
"aria-busy": i,
|
|
222
|
-
children:
|
|
223
|
+
children: t.getHeaderGroups().map((e) => /* @__PURE__ */ o(ae, { showBorders: g, children: e.headers.map(Te) }, e.id))
|
|
223
224
|
}
|
|
224
225
|
),
|
|
225
226
|
/* @__PURE__ */ o("tbody", { className: Y, children: i ? Array.from(
|
|
226
227
|
{ length: J },
|
|
227
|
-
(e,
|
|
228
|
-
) : P.map((e,
|
|
228
|
+
(e, n) => ve(n)
|
|
229
|
+
) : P.map((e, n) => Pe(e, n)) })
|
|
229
230
|
] }) }),
|
|
230
231
|
S && !i && /* @__PURE__ */ o(
|
|
231
232
|
Be,
|
|
232
233
|
{
|
|
233
234
|
pageIndex: a.pageIndex,
|
|
234
235
|
pageSize: a.pageSize,
|
|
235
|
-
totalCount:
|
|
236
|
-
variant:
|
|
237
|
-
labels:
|
|
236
|
+
totalCount: s || h.length,
|
|
237
|
+
variant: me,
|
|
238
|
+
labels: se,
|
|
238
239
|
renderPageSizeSelectorDropdownItem: ce,
|
|
239
240
|
renderPageSizeSelectorInputItem: ge,
|
|
240
241
|
onPageChange: (e) => C({ ...a, pageIndex: e }),
|
|
241
242
|
onPageSizeChange: (e) => C({ ...a, pageSize: e, pageIndex: 0 }),
|
|
242
|
-
className:
|
|
243
|
+
className: ne
|
|
243
244
|
}
|
|
244
245
|
)
|
|
245
246
|
] });
|
|
@@ -248,7 +249,7 @@ c.displayName = "Table";
|
|
|
248
249
|
c.HeadCellContent = Oe;
|
|
249
250
|
c.BodyCellContent = k;
|
|
250
251
|
c.HeadCellContentSortable = $e;
|
|
251
|
-
c.createColumnHelper =
|
|
252
|
+
c.createColumnHelper = ze;
|
|
252
253
|
export {
|
|
253
254
|
c as Table
|
|
254
255
|
};
|
|
@@ -4,10 +4,5 @@ export interface TableBodyRowProps extends React.HTMLAttributes<HTMLTableRowElem
|
|
|
4
4
|
* @default false
|
|
5
5
|
*/
|
|
6
6
|
showBorders?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Выбрана ли строка
|
|
9
|
-
* @default false
|
|
10
|
-
*/
|
|
11
|
-
isSelected?: boolean;
|
|
12
7
|
}
|
|
13
8
|
export declare const TableBodyRow: import('react').ForwardRefExoticComponent<TableBodyRowProps & import('react').RefAttributes<HTMLTableRowElement>>;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { css as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { theme as
|
|
5
|
-
const { color:
|
|
6
|
-
({ children:
|
|
7
|
-
const
|
|
8
|
-
borderBottom:
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { css as m, cx as c } from "@emotion/css";
|
|
3
|
+
import { forwardRef as i } from "react";
|
|
4
|
+
import { theme as d } from "../../../../utils/theme/index.js";
|
|
5
|
+
const { color: o } = d, f = i(
|
|
6
|
+
({ children: r, className: e, showBorders: t = !1, ...a }, l) => {
|
|
7
|
+
const s = m({
|
|
8
|
+
borderBottom: t ? `1px solid ${o.border.neutralAlphaLow}` : "none",
|
|
9
|
+
transition: "background-color 0.15s ease-in-out",
|
|
10
|
+
"&:hover": {
|
|
11
|
+
backgroundColor: o.fill.neutralPrimaryHover
|
|
12
|
+
}
|
|
9
13
|
});
|
|
10
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ n("tr", { ref: l, className: c(s, e), ...a, children: r });
|
|
11
15
|
}
|
|
12
16
|
);
|
|
13
|
-
|
|
17
|
+
f.displayName = "TableBodyRow";
|
|
14
18
|
export {
|
|
15
|
-
|
|
19
|
+
f as TableBodyRow
|
|
16
20
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { css as n, cx as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { theme as
|
|
5
|
-
import { Box as
|
|
6
|
-
const { color:
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { css as n, cx as f } from "@emotion/css";
|
|
3
|
+
import { memo as k, useState as d, useRef as x, useCallback as E, useEffect as W } from "react";
|
|
4
|
+
import { theme as $ } from "../../../../utils/theme/index.js";
|
|
5
|
+
import { Box as m } from "../../Box/Box.js";
|
|
6
|
+
const { color: o, cornerRadius: C } = $, P = n({
|
|
7
7
|
position: "relative",
|
|
8
8
|
borderRadius: C.md,
|
|
9
9
|
overflow: "hidden",
|
|
@@ -14,66 +14,65 @@ const { color: s, cornerRadius: C } = W, z = n({
|
|
|
14
14
|
bottom: 14,
|
|
15
15
|
width: 96,
|
|
16
16
|
pointerEvents: "none",
|
|
17
|
-
zIndex: 1,
|
|
18
17
|
transition: "opacity 0.2s ease"
|
|
19
18
|
},
|
|
20
19
|
"&::before": {
|
|
21
20
|
left: 0,
|
|
22
|
-
background:
|
|
21
|
+
background: `linear-gradient(to left, transparent 0%, ${o.fill.bgPrimary} 100%)`
|
|
23
22
|
},
|
|
24
23
|
"&::after": {
|
|
25
24
|
right: 0,
|
|
26
|
-
background:
|
|
25
|
+
background: `linear-gradient(to right, transparent 0%, ${o.fill.bgPrimary} 100%)`
|
|
27
26
|
}
|
|
28
27
|
}), N = n({
|
|
29
28
|
overflowX: "auto",
|
|
30
29
|
scrollbarWidth: "thin",
|
|
31
|
-
scrollbarColor: `${
|
|
32
|
-
}), T =
|
|
30
|
+
scrollbarColor: `${o.scrollbar.thumbPrimary} ${o.scrollbar.trackPrimary}`
|
|
31
|
+
}), T = k(
|
|
33
32
|
({
|
|
34
|
-
data:
|
|
33
|
+
data: b,
|
|
35
34
|
children: h,
|
|
36
35
|
className: p,
|
|
37
36
|
scrollContainerClassName: u,
|
|
38
37
|
showBorders: w = !1,
|
|
39
|
-
...
|
|
38
|
+
...y
|
|
40
39
|
}) => {
|
|
41
|
-
const [
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
44
|
-
const { scrollLeft:
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const [S, g] = d(!1), [v, R] = d(!1), s = x(null), e = E(() => {
|
|
41
|
+
const r = s.current;
|
|
42
|
+
if (!r) return;
|
|
43
|
+
const { scrollLeft: t, scrollWidth: a, clientWidth: l } = r, i = a > l;
|
|
44
|
+
g(i && t > 0), R(
|
|
45
|
+
i && t < a - l - 1
|
|
47
46
|
);
|
|
48
47
|
}, []);
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
|
|
48
|
+
W(() => {
|
|
49
|
+
const r = s.current;
|
|
50
|
+
if (!r) return;
|
|
51
|
+
e();
|
|
52
|
+
const t = new ResizeObserver(e);
|
|
53
|
+
return t.observe(r), r.addEventListener("scroll", e), () => {
|
|
54
|
+
t.disconnect(), r.removeEventListener("scroll", e);
|
|
56
55
|
};
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
border: w ? `1px solid ${
|
|
56
|
+
}, [e, b]);
|
|
57
|
+
const L = n({
|
|
58
|
+
border: w ? `1px solid ${o.border.neutralAlphaLow}` : "transparent",
|
|
60
59
|
"&::before": {
|
|
61
|
-
opacity:
|
|
60
|
+
opacity: S ? 1 : 0
|
|
62
61
|
},
|
|
63
62
|
"&::after": {
|
|
64
|
-
opacity:
|
|
63
|
+
opacity: v ? 1 : 0
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
|
|
66
|
+
return /* @__PURE__ */ c(
|
|
67
|
+
m,
|
|
69
68
|
{
|
|
70
|
-
className:
|
|
71
|
-
...
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
|
|
69
|
+
className: f(P, L, p),
|
|
70
|
+
...y,
|
|
71
|
+
children: /* @__PURE__ */ c(
|
|
72
|
+
m,
|
|
74
73
|
{
|
|
75
|
-
ref:
|
|
76
|
-
className:
|
|
74
|
+
ref: s,
|
|
75
|
+
className: f(N, u),
|
|
77
76
|
children: h
|
|
78
77
|
}
|
|
79
78
|
)
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cx as h } from "@emotion/css";
|
|
3
|
-
import { Chart as b
|
|
3
|
+
import { Chart as b } from "../../../node_modules/@highcharts/react/Highcharts.js";
|
|
4
|
+
import "../../../node_modules/@highcharts/react/options/Title.js";
|
|
5
|
+
import { Tooltip as C } from "../../../node_modules/@highcharts/react/options/Tooltip.js";
|
|
4
6
|
import { useRef as T, useEffect as y, useMemo as o } from "react";
|
|
5
7
|
import { buildLineChartOptions as E, buildTooltipProps as L } from "./utils.js";
|
|
6
8
|
const j = ({
|
|
7
9
|
color: n = "positive",
|
|
8
|
-
data:
|
|
9
|
-
xAxis:
|
|
10
|
-
yAxis:
|
|
10
|
+
data: i = [],
|
|
11
|
+
xAxis: s,
|
|
12
|
+
yAxis: m,
|
|
11
13
|
containerProps: e,
|
|
12
|
-
highcharts:
|
|
14
|
+
highcharts: l,
|
|
13
15
|
tooltip: r,
|
|
14
|
-
className:
|
|
15
|
-
style:
|
|
16
|
+
className: p,
|
|
17
|
+
style: f
|
|
16
18
|
}) => {
|
|
17
19
|
const t = T(null);
|
|
18
20
|
y(() => () => {
|
|
19
21
|
typeof t == "object" && t?.current?.chart && t.current.chart.destroy();
|
|
20
22
|
}, []);
|
|
21
|
-
const c = o(() => E(n,
|
|
23
|
+
const c = o(() => E(n, i, s, m, !!r), [n, i, s, m, r]), u = o(() => r ? L(r) : { enabled: !1 }, [r]), d = o(
|
|
22
24
|
() => ({
|
|
23
25
|
...e,
|
|
24
|
-
className: h(e?.className,
|
|
25
|
-
style: { ...e?.style, ...
|
|
26
|
+
className: h(e?.className, p),
|
|
27
|
+
style: { ...e?.style, ...f }
|
|
26
28
|
}),
|
|
27
|
-
[e,
|
|
29
|
+
[e, p, f]
|
|
28
30
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ a(
|
|
30
32
|
b,
|
|
31
33
|
{
|
|
32
|
-
highcharts:
|
|
34
|
+
highcharts: l,
|
|
33
35
|
ref: t,
|
|
34
36
|
options: c,
|
|
35
37
|
containerProps: d,
|
|
36
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ a(C, { ...u })
|
|
37
39
|
}
|
|
38
40
|
);
|
|
39
41
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cx as
|
|
3
|
-
import { Chart as d
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { cx as l } from "@emotion/css";
|
|
3
|
+
import { Chart as d } from "../../../node_modules/@highcharts/react/Highcharts.js";
|
|
4
|
+
import { Title as C } from "../../../node_modules/@highcharts/react/options/Title.js";
|
|
5
|
+
import "../../../node_modules/@highcharts/react/options/Tooltip.js";
|
|
4
6
|
import { forwardRef as P, useRef as y, useEffect as R, useMemo as n } from "react";
|
|
5
7
|
import { buildPieProgressChartOptions as x } from "./utils.js";
|
|
6
8
|
const b = P(
|
|
@@ -11,28 +13,28 @@ const b = P(
|
|
|
11
13
|
label: a = (o) => `${o}%`,
|
|
12
14
|
containerProps: t,
|
|
13
15
|
className: i,
|
|
14
|
-
style:
|
|
15
|
-
},
|
|
16
|
-
const o = y(null), r =
|
|
16
|
+
style: m
|
|
17
|
+
}, p) => {
|
|
18
|
+
const o = y(null), r = p || o;
|
|
17
19
|
R(() => () => {
|
|
18
20
|
typeof r == "object" && r?.current?.chart && r.current.chart.destroy();
|
|
19
21
|
}, [r]);
|
|
20
|
-
const
|
|
22
|
+
const u = n(() => x(e, s), [e, s]), h = n(
|
|
21
23
|
() => ({
|
|
22
24
|
...t,
|
|
23
|
-
className:
|
|
24
|
-
style: { ...t?.style, ...
|
|
25
|
+
className: l(t?.className, i),
|
|
26
|
+
style: { ...t?.style, ...m }
|
|
25
27
|
}),
|
|
26
|
-
[t, i,
|
|
28
|
+
[t, i, m]
|
|
27
29
|
);
|
|
28
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ f(
|
|
29
31
|
d,
|
|
30
32
|
{
|
|
31
33
|
highcharts: c,
|
|
32
34
|
ref: r,
|
|
33
|
-
options:
|
|
34
|
-
containerProps:
|
|
35
|
-
children: /* @__PURE__ */
|
|
35
|
+
options: u,
|
|
36
|
+
containerProps: h,
|
|
37
|
+
children: /* @__PURE__ */ f(C, { children: a?.(e) })
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
40
|
}
|